#ifndef _STOCK_TIMESYNC_
#define _STOCK_TIMESYNC_

#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "common/include/stock_update.h"
#include "common/include/stock_common.h"


typedef struct stock_timesync_t {
    uint32_t delta;
} stock_timesync;

typedef struct stock_timesync_msg_t {
    unsigned char  header[STOCK_HEADER_LEN];
    stock_timesync timesync;
} stock_timesync_msg;

#define STOCK_TIMESYNC_MSG_SIZE (sizeof(stock_timesync_msg))


int 
stock_timesync_send(int sock, stock_update *upd);


int 
stock_timesync_recv(int sock, stock_timesync *sync);

#endif
